package ui;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;


public class TypeFrame extends JFrame {
    public static final int WIN_WIDTH = 500;
    public static final int WIN_HEIGHT = 600;
    private static  Image icon=null;
    static {
        try {
            icon = ImageIO.read(new File("src/main/resources/tit.png"));
        } catch (IOException e) {
            System.out.println("图片没有找到");
        }
    }
    public TypeFrame() {
        super("打字游戏");
        setIconImage(icon);
        setSize(WIN_WIDTH, WIN_HEIGHT);
        TypePanel  panel = new TypePanel();
        addKeyListener(panel);
        add(panel);
        setVisible(true);
    }
}
